package com.ele.pojo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
// Schema注解用于标注响应的实体类信息
@Schema(name = "ResponseData", description = "接口统一响应的数据对象")
public class ResponseData<T> {
    // 表示本次响应的数据状态编码
    @Schema(name = "code", description="响应返回状态码", required = true,type = "Integer")
    private Integer code;
    @Schema(name = "message", description="响应提示信息", type = "String")
    private String message;
    @Schema(name = "data", description="响应单个数据信息", type = "object")
    private T data;
    @Schema(name = "data", description="响应列表数据信息", type = "List")
    private List<T> datas;
    // 分页的总记录数
    @Schema(name = "total", description="分页的总记录数", type = "Long")
    private Long total;
}
